﻿@{
    ViewBag.Title = "Home Page";
}
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script>
    function AuthClick()
    {
        $.ajax({
            type: 'post',
            url: '@Url.Action("Auth","Home")',
            data:{form:$("#form1").serialize()},
            success:function(data)
            {
                alert("success");
            },
            error:function(error)
            {
                alert("Error");
            }
        })
    }
</script>
<h1>这是我的客户端</h1>
<label>请求到的accessToken：@Model</label>

<button type="button" onclick="AuthClick()">认证</button>


<form id="form1" action="@ViewBag.Action" method="POST">
    <div>
        Access Token<br />
        <input id="AccessToken" name="AccessToken" width="604" type="text" value="@ViewBag.AccessToken" />
        <input id="Authorize" name="submit.Authorize" value="Authorize" type="submit" />
        <br />
        <br />
        Refresh Tokensh Token<br />
        <input id="RefreshToken" name="RefreshToken" width="604" type="text" value="@ViewBag.RefreshToken" />
        <input id="Refresh" name="submit.Refresh" value="Refresh" type="submit" />
        <br />
        <br />
        <input id="CallApi" name="submit.CallApi" value="Access Protected Resource API" type="submit" />
    </div>
    <div>
        @ViewBag.ApiResponse
    </div>
</form>
<a href="@Url.Action("DemoRequestCode","Home")">授权</a>
